#ifndef POINT_H
#define POINT_H


class CPoint
{
    public:
        CPoint( void );
        CPoint( const int x, const int y );
        CPoint( const CPoint& pt );
        ~CPoint( void );

        void Clear( void );
        CPoint& operator=( const CPoint& pt );

        //
        //  ACCESSORS AND MUTATORS
        //
        void Set( const int x, const int y );
        void Set( const CPoint& pt );
        int GetX( void ) const { return m_X; }
        int GetY( void ) const { return m_Y; }

    private:
        int m_X;
        int m_Y;
};

inline void CPoint::Clear( void )
{
    m_X = m_Y = 0;
}

inline CPoint& CPoint::operator=( const CPoint& pt )
{
    // check for self assingment
    if( this != &pt )
    {
        m_X = pt.GetX();
        m_Y = pt.GetY();
    }

    return *this;
}

inline void CPoint::Set( const CPoint& pt )
{
    *this = pt;
}

inline void CPoint::Set( const int x, const int y )
{
    m_X = x;
    m_Y = y;
}

#endif // POINT_H
